package com.dahuyou.tryy.too.parse.clazz.file.clazzfile.constantpool.item;

import com.dahuyou.tryy.too.parse.clazz.file.clazzfile.ClassReader;
import com.dahuyou.tryy.too.parse.clazz.file.clazzfile.constantpool.ConstantInfo;

public class ConstantIntegerInfo implements ConstantInfo {

    private int val;

    @Override
    public void readInfo(ClassReader reader) {
//        this.val = reader.readUint32TInteger();
        this.val = reader.readU4TInteger();
    }

    @Override
    public int tag() {
        return this.CONSTANT_TAG_INTEGER;
    }

    public int value(){
        return this.val;
    }

    @Override
    public void showInfo() {
        System.out.println("tag 是：" + this.tag() + ", integer值是：" + this.value());
    }
}
